//
//  HomeTableViewController.swift
//  Weibo
//
//  Created by mac on 15/11/26.
//  Copyright © 2015年 zsl. All rights reserved.
//

import UIKit
import AFNetworking
import SVProgressHUD

class HomeTableViewController: BaseTableViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        demo()
    }
    
    func demo(){
        
        let AFN = AFHTTPSessionManager()
        //@"application/json", @"text/json", @"text/javascript"  默认支持
     //错误信息 NSLocalizedDescription=Request failed: unacceptable content-type: text/html
        AFN.responseSerializer.acceptableContentTypes?.insert("text/html")
    let urlString = "http://www.weather.com.cn/data/sk/101010100.html"
        //显示指示器
        SVProgressHUD.show()
        AFN.GET(urlString, parameters: nil, success: { (task , result) -> Void in
            
            SVProgressHUD.dismiss()
            
            print (result)
            
            }) { (task , error ) -> Void in
                
                print (error)
                
        }
        
    }

}
